package br.com.novagalvao.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Transient;

import org.springframework.security.core.GrantedAuthority;

@Entity
public class Grupo implements GrantedAuthority{

	private int id;
	private String nome;

	@Id
	@SequenceGenerator(name = "sequenceGenerator", sequenceName = "grupo_seq", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "sequenceGenerator")
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return id;
	}

	public String getNome() {
		return nome;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	@Transient
	public String getAuthority() {
		return getNome();
	}

}
